package com.fenghongzhang.kuaishou.index.home.model;

import com.fenghongzhang.kuaishou.common.XinYIServerApi;
import com.fenghongzhang.kuaishou.index.home.contract.OptimalFragmentContract;
import com.fenghongzhang.kuaishou.index.home.entity.VideoBean;
import com.fenghongzhang.kuaishou.utils.RetrofitManager;

import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;

/**
 * 精选的数据model
 */
public class OptimalModel implements OptimalFragmentContract.IOptimalModel {

    @Override
    public void getVideoList(Observer<VideoBean[]> observer) {
        RetrofitManager.getInstance().getRetrofit()
                .create(XinYIServerApi.class)
                .getVideoList()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(observer);
    }

    @Override
    public void destroy() {

    }
}
